package com.bwda.dsrs.systemservice.domain.form.msgtemplate;

import com.bwda.dsrs.base.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Size;
import java.util.Date;
/**
 * 邮件
 *
 * @author yj
 * @date 2019年4月28日
 */
@Data
@ApiModel(description = "邮件短信模板表")
public class MsgTemplateCreateForm {

	@ApiModelProperty(value = "模板编码")
	@Size(min = 1,max = 60,message = "模板编码在0-60之间")
	private String code;

	@ApiModelProperty(value = "模板名称")
	@Size(min = 1,max =60,message = "模板名称在0-60之间")
	private String name;

	@ApiModelProperty(value = "模板内容")
	@Size(min = 1,max = 140,message = "模板内容在0-140之间")
	private String content;

	@ApiModelProperty(value = "备注")
	@Size(min = 0,max =140,message = "备注在0-140之间")
	private String remark;

	@ApiModelProperty(value = " 0 未删除  1已删除")
	private Integer delFlag;

	@ApiModelProperty(value = "1 邮件  2短信")
	private Integer type;

	@ApiModelProperty(value = "创建人")
	private String createUserCode;

	@ApiModelProperty(value = "创建时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date createTime;

	@ApiModelProperty(value = "更新人")
	private String updateUserCode;

	@ApiModelProperty(value = "更新时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date updateTime;

	public Date getCreateTime() {
		if (createTime != null){
			return (Date) createTime.clone();
		}

		return null;
	}

	public void setCreateTime(Date createTime) {
		if (createTime != null){
			this.createTime = (Date) createTime.clone();
		}
	}

	public Date getUpdateTime() {
		if (updateTime != null){
			return (Date) updateTime.clone();
		}

		return null;
	}

	public void setUpdateTime(Date updateTime) {
		if (updateTime != null){
			this.updateTime = (Date) updateTime.clone();
		}
	}
}